<?php

class receipt_imports{
	function getAllTransactionsById($im_id){
		$transaction = array();
		qdbconn();		
		$query = "SELECT pro_name,pla_name,reci_quantity,reci_price
				  FROM receipt_imports
				  	LEFT JOIN products on pro_id = reci_pro_id
				  	LEFT JOIN places on pla_id = reci_propla_id
				  WHERE reci_im_id = $im_id";
		
		$result = mysql_query($query);
		$i == 0;
		while ($row = mysql_fetch_row($result)) {
			$transaction[$i]['pro_name']		= $row[0];
			$transaction[$i]['pla_name']		= $row[1];
			$transaction[$i]['reci_quatity']	= $row[2];
			$transaction[$i]['reci_price']		= $row[3];
			$i++;
		}
		return $transaction;
	}
}

?>